<?php

namespace app\api\controller;

class Category extends \app\common\controller\Api
{
    protected $noNeedLogin = ['index'];
    protected $noNeedRight = '*';
    /**
     * 分类列表
     */
    public function index($type='post'){
        $categorys= \app\common\model\Category::where('status','normal')->where('type',$type)->field('id,name,type,weigh,image,createtime,updatetime,status,flag')->select();
        $this->success('分类列表',$categorys);
    }
}